package lu.uni.adtool.adtconverter;

class EditAction implements Comparable<EditAction>
{
  /**
   * 
   */
  public static enum ActionType
  {
    /**
     * Remove node from left tree.
     */
    INS_NODE_RT,
    /**
     * Remove node from right tree.
     */
    RM_NODE_RT,
  }
  private ActionType type;
  private int leftIndex;
  private int rightIndex;
  private boolean leftStrat;
  //*
   //Constructs a new instance.
   //@param newType
   //@param index

  /**
   * Constructs a new instance.
   * @param newType
   * @param index
   * @param index2
   */
  public EditAction(final ActionType newType, final int newLeftIndex,
      final int newRightIndex, final boolean left)
  {
    this.type = newType;
    leftIndex = newLeftIndex;
    rightIndex = newRightIndex;
    leftStrat = left;
  }
  public int compareTo(final EditAction a)
  {
    return leftIndex-a.getLeftIndex();
  }

  /**
   * Gets the type for this instance.
   *
   * @return The type.
   */
  public ActionType getType()
  {
    return this.type;
  }

  /**
   * Gets the nodeIndex for this instance.
   *
   * @return The nodeIndex.
   */
  public int getLeftIndex()
  {
    return this.leftIndex;
  }

  /**
   * Gets the extraIndex for this instance.
   *
   * @return The extraIndex.
   */
  public int getRightIndex()
  {
    return this.rightIndex;
  }

  /**
   * Determines if this instance is leftStrat.
   *
   * @return The leftStrat.
   */
  public boolean isLeftStrat()
  {
    return this.leftStrat;
  }

  public String toString()
  {
    return getType()+" nI="+leftIndex+ " eI="+rightIndex;
  }

}

